package org.poem.handler;

import com.alibaba.fastjson.JSONObject;

import io.swagger.annotations.*;
import org.poem.CommonVO;
import org.poem.handler.impl.CTaskDetailService;
import org.poem.result.CommonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 任务详情
 *
 * @author sangfor
 */
@RestController
@RequestMapping("/v1/taskDetail")
@Api(tags = {"06-任务详情信息管理"})
public class CTaskDetailController {

    private static final Logger logger = LoggerFactory.getLogger(CTaskDetailController.class);


    @Autowired
    private CTaskDetailService detailService;


    /**
     * 获取当前的主题下的可以依赖任务列表
     *
     * @param subjectId
     * @return
     */
    @ApiOperation(value = "0601_获取所有数据迁移任务", notes = "获取所有数据迁移任务")
    @ApiResponses
            ({
                    @ApiResponse(code = 400, message = "请求参数没有填好"),
                    @ApiResponse(code = 404, message = "请求路径没有找到")
            })
    @GetMapping("/getTaskDetailList/{subjectId}")
    @ResponseBody
    public CommonResult<List<CommonVO>> getTaskDetailList(@PathVariable("subjectId") Long subjectId) {
        return detailService.getTaskDetailList(subjectId);
    }
}
